<?php

namespace App\Http\Requests\GoodController;

use Illuminate\Foundation\Http\FormRequest;

class GoodShowRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id' => 'required|integer|gte:1'
        ];
    }

    public function messages()
    {
        return [
            'id.required' => __('商品ID不能为空'),
            'id.integer' => __('商品ID必须是整数类型'),
            'id.gte' => __('商品ID必须大于或等于1'),
        ];
    }
}
